<!DOCTYPE HTML>
<html>
  <head>
    <title>-webkit-columns shorthand getPropertyValue test</title>
    <style>
      .test {
        width: 100px;
        height: 100px;
      }
    </style>
    <script src="../../resources/js-test.js"></script>
    <script>
      if (window.testRunner)
        testRunner.dumpAsText();
    </script>
  </head>
  <body>
    <div id="columns1" class="test" style="-webkit-columns: 10px;"></div>
    <div id="columns2" class="test" style="-webkit-columns: 10;"></div>
    <div id="columns3" class="test" style="-webkit-columns: 10px auto;"></div>
    <div id="columns4" class="test" style="-webkit-columns: auto;"></div>
    <div id="columns5" class="test" style="-webkit-columns: auto 2;"></div>
    <div id="columns6" class="test" style="-webkit-column-width: 10px; -webkit-column-count: 2;"></div>
    <div id="columns7" class="test" style="-webkit-column-width: auto; -webkit-column-count: auto;"></div>
    <div id="columns8" class="test" style="-webkit-columns: foo;"></div>
    <div id="columns9" class="test" style="-webkit-column-width: 10px;"></div>
    <script>
      description("<a href=\"https://bugs.webkit.org/show_bug.cgi?id=111011\">Bug 111011: getPropertyValue for -webkit-columns returns null, should compute the shorthand value</a>");

      function webkitColumnsValue(id) {
        var element = document.getElementById(id);
        return element.style.getPropertyValue("-webkit-columns");
      }

      shouldBeEqualToString('webkitColumnsValue("columns1")', '10px auto');
      shouldBeEqualToString('webkitColumnsValue("columns2")', 'auto 10');
      shouldBeEqualToString('webkitColumnsValue("columns3")', '10px auto');
      shouldBeEqualToString('webkitColumnsValue("columns4")', 'auto auto');
      shouldBeEqualToString('webkitColumnsValue("columns5")', 'auto 2');
      shouldBeEqualToString('webkitColumnsValue("columns6")', '10px 2');
      shouldBeEqualToString('webkitColumnsValue("columns7")', 'auto auto');
      debug("NOTE: 'foo' is an illegal CSS value for '-webkit-columns'.");
      shouldBeEqualToString('webkitColumnsValue("columns8")', "");
      debug("NOTE: If only few longhand properties are specified, getPropertyValue for shorthand property returns empty string.")
      shouldBeEqualToString('webkitColumnsValue("columns9")', "");
    </script>
  </body>
</html>
